#include "RoundDialog.h"
#include "ui_RoundDialog.h"
#include <cmath>

RoundDialog::RoundDialog(QWidget *parent) :
    QDialog(parent),
    ui(new Ui::RoundDialog)
{
    ui->setupUi(this);
    _CBOp= ui->comboBoxOp;
}

RoundDialog::~RoundDialog()
{
    delete ui;
}

int RoundDialog::getEqPixel(double val){
    int oper = _CBOp->currentIndex();
    switch(oper){
        case INF:   return  (val > 0.0 )? std::floor(val):  std::ceil(val);
        case SUP:   return  (val > 0.0 )? std::ceil(val):  std::floor(val);
    default: break;
    }
}
